package com.kl.forum.api;


import com.kl.forum.service.CircleService;
import com.kl.forum.service.HomePageService;
import com.kl.forum.service.MemberService;
import com.kl.forum.util.ResultInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api("用户模块")
@RestController
@RequestMapping("/user")
public class MemberControllerAPI {
    @Autowired
    private CircleService circleService;
    @Autowired
    private HomePageService homePageService;
    @Autowired
    private MemberService memberService;


    /**我的
     * @param uuId
     * @return
     */
    @ApiOperation(value = "获取user_id",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "uuId", value = "用户uuId", required = true, dataType = "String"),


    })
    @RequestMapping(value = "/findUserId",method= RequestMethod.GET)
    public  ResultInfo findUserId(String uuId){
        return   memberService.findUserId(uuId);
    }


    /**关注：
     * 我关注的人发表的帖子
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    @ApiOperation(value = "我关注的人发表的帖子",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", required = true, dataType = "Long"),

    })
    @RequestMapping(value = "/findMyFollowUserCircle",method= RequestMethod.GET)
    public  ResultInfo findMyFollowUserCircle(Integer userId,Integer pageNum ,Integer pageSize){
        return   homePageService.findMyFollowUserCircle(userId,pageNum,pageSize);
    }


    /**关注：
     * 我的关注健康号列表
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    @ApiOperation(value = "我的关注健康号列表",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", required = true, dataType = "Long"),

    })
    @RequestMapping(value = "/findMyHealthyNumByUserId",method= RequestMethod.GET)
    public  ResultInfo findMyHealthyNumByUserId(Integer userId,Integer pageNum ,Integer pageSize){
        return   homePageService.findMyHealthyNumByUserId(userId,pageNum,pageSize);
    }


    /**
     * @我的点赞
     * @param userId
     * @return
     */
    @ApiOperation(value = "@我的 点赞",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyLight",method = RequestMethod.GET)
    public ResultInfo findMyLight(Integer userId, Integer pageNum, Integer pageSize){
        return circleService.findMyLight(userId,pageNum,pageSize);
    }


    /**
     * @我的评论
     * @param userId
     * @return
     */
    @ApiOperation(value = "@我的评论",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyComment",method = RequestMethod.GET)
    public ResultInfo findMyComment(Integer userId,Integer pageNum,Integer pageSize){
        return circleService.findMyComment(userId,pageNum,pageSize);
    }

    /**
     * 各个计数数量+关注状态
     * @param userId
     * @return
     */
    @ApiOperation(value = "各个计数数量+关注状态",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),

    })
    @RequestMapping(value = "findMyCounts",method = RequestMethod.GET)
    public ResultInfo findMyCounts(Integer userId){
        return memberService.findMyCounts(userId);
    }

    /**
     * 关注状态
     * @param userId
     * @return
     */
    @ApiOperation(value = "关注状态",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "coverUserId", value = "用户Id", required = false, dataType = "Long"),

    })
    @RequestMapping(value = "findUserFollowStatus",method = RequestMethod.GET)
    public ResultInfo findUserFollowStatus(Integer userId,@RequestParam(value = "coverUserId",required = false) Integer coverUserId){
        return memberService.findUserFollowStatus(userId,coverUserId);
    }


    /**
     * 我的粉丝数量
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的粉丝",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
    })
    @RequestMapping(value = "findMyFansCount",method = RequestMethod.GET)
    public ResultInfo findMyFansCount(Integer userId){
        return memberService.findMyFans(userId);
    }


    /**
     * 我的动态数量
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的动态数量",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),

    })
    @RequestMapping(value = "findMyCircleArticleCount",method = RequestMethod.GET)
    public ResultInfo findMyCircleArticleCount(Integer userId){
        return memberService.findMyCircleArticleCount(userId);
    }
    /**
     * 我的关注数量 用户  圈子
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的关注数量 用户 圈子",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
    })
    @RequestMapping(value = "findMyFollowCount",method = RequestMethod.GET)
    public ResultInfo findMyFollowCount(Integer userId){
        return memberService.findMyFollowCount(userId);
    }


    /**
     * 我的粉丝列表
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的粉丝列表",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyFansList",method = RequestMethod.GET)
    public ResultInfo findMyFansList(Integer userId,Integer pageNum,Integer pageSize){
        return memberService.findMyFansList(userId,pageNum,pageSize);
    }



    /**
     * 我的动态
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的动态列表",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id 列表", required = false, dataType = "Long"),
            @ApiImplicitParam(name = "coverUserId", value = "其他用户Id 状态", required = false, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyCircleArticleList",method = RequestMethod.GET)
    public ResultInfo findMyCircleArticleList(@RequestParam(value = "userId",required = false) Integer userId,@RequestParam(value = "coverUserId",required = false) Integer coverUserId,Integer pageNum,Integer pageSize){
        return memberService.findMyCircleArticle(userId,coverUserId,pageNum,pageSize);
    }



    /**
     * 我的关注 用户
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的关注列表 用户 ",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "type", value = "1用户 2圈子", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyFollowList",method = RequestMethod.GET)
    public ResultInfo findMyFollowList(Integer userId,Integer type,Integer pageNum,Integer pageSize){
        return memberService.findMyFollowList(userId,type,pageNum,pageSize);
    }


    /**
     * 我的收藏 帖子 商家
     * @param userId
     * @return
     */
    @ApiOperation(value = "我的收藏列表 帖子 商家",notes="我的")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户Id", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "type", value = "1帖子 2商家", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageNum", value = "页数", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "pageSize", value = "页码大小", required = true, dataType = "Long")
    })
    @RequestMapping(value = "findMyCollectList",method = RequestMethod.GET)
    public ResultInfo findMyCollectList(Integer userId,Integer type,Integer pageNum,Integer pageSize){
        return memberService.findMyCollectList(userId,type,pageNum,pageSize);
    }





}
